/*
 * @Author: viivLgr 
 * @Date: 2018-03-22 12:41:52 
 * @Last Modified by: viivLgr
 * @Last Modified time: 2018-03-26 10:33:18
 */
'use strict';
var _util = require('util/util.js');
var _order = {
    // 取消订单
    cancel: function(orderNo, resolve, reject){
        _util.request({
            url: _util.getServerUrl('/order/cancel.do'),
            data: {
                orderNo: orderNo
            },
            success: resolve,
            error: reject
        });
    },
    // 获取订单详情
    getOrderDetail: function(orderNo, resolve, reject){
        _util.request({
            url: _util.getServerUrl('/order/detail.do'),
            data: {
                orderNo: orderNo
            },
            success: resolve,
            error: reject
        });
    },
    // 获取订单列表
    getOrderList: function(orderInfo, resolve, reject){
        _util.request({
            url: _util.getServerUrl('/order/list.do'),
            data: orderInfo,
            success: resolve,
            error: reject
        });
    },
    // 生成订单
    createOrder: function(orderInfo, resolve, reject){
        _util.request({
            url: _util.getServerUrl('/order/create.do'),
            data: orderInfo,
            success: resolve,
            error: reject
        });
    },
    // 获取商品列表
    getProductList: function(resolve, reject){
        _util.request({
            url: _util.getServerUrl('/order/get_order_cart_product.do'),
            success: resolve,
            error: reject
        });
    }
};

module.exports = _order;